package com.comac.tasks.manager.app.feign;


import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.comac.tasks.manager.app.config.TaskFeignAutoConfiguration;
import com.comac.tasks.manager.app.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author wfb
 * @Classname TasksManagerAppService
 * @Description 待办组件对外提供接口
 * @Date 2021年12月17日17:33:49
 */
@FeignClient(url = "${feign.task.taskUrl}",
        name = "tasks-manager-app",
        path = "tasks-manager-app",
        configuration = TaskFeignAutoConfiguration.class)
public interface TasksManagerAppService {

    /**
     * 新增代办对外接口
     *
     * @param tasksManagerDTO
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/insertTasks", method = RequestMethod.POST)
    Response insertTasks(@RequestBody TasksManagerDTO tasksManagerDTO);

    /**
     * 批量新增代办对外接口
     *
     * @param batchInsertDTO
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/batchInsertTasks", method = RequestMethod.POST)
    Response batchInsertTasks(@RequestBody TasksManagerBatchInsertDTO batchInsertDTO);

    /**
     * 新增代办对外接口
     *
     * @param
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/updateTasks", method = RequestMethod.POST)
    Response updateTasks(@RequestBody TasksManagerUpOperatorDTO upOperatorDTO);

    /**
     * 代办组件‘计划完成时间’更新接口
     *
     * @param
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/updateTasksExpectedCompletionTimeByTaskId", method = RequestMethod.POST)
    Response updateTasksExpectedCompletionTimeByTaskId(@RequestBody TasksManagerUpECTimeDTO eCTimeUpdateDTO);

    /**
     * 新增代办对外接口
     *
     * @param detailsQry
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/listTasksDetails", method = RequestMethod.POST)
    SingleResponse<TasksManagerVO> listTasksDetails(@RequestBody TasksManagerDetailsQry detailsQry);

    /**
     * 新增代办对外接口
     *
     * @param tasksManagerQry
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/listTasks", method = RequestMethod.POST)
    PageResponse<TasksManagerVO> listTasks(@RequestBody TasksManagerQry tasksManagerQry);

    /**
     * 新增代办对外接口
     *
     * @param tasksManagerQry
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/listTasksByCreator", method = RequestMethod.POST)
    PageResponse<TasksManagerVO> listTasksByCreator(@RequestBody TasksManagerQry tasksManagerQry);

    /**
     * 新增代办对外接口
     *
     * @param tasksManagerUpDTO
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/updateStatus", method = RequestMethod.POST)
    Response updateStatus(@RequestBody TasksManagerUpDTO tasksManagerUpDTO);

    /**
     * 新增代办对外接口
     *
     * @param tasksManagerDelDTO
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/delete", method = RequestMethod.POST)
    Response delete(@RequestBody TasksManagerDelDTO tasksManagerDelDTO);

    /**
     * 更新待办任务类型 (针对历史数据）
     *
     * @param tasksManagerUpTaskTypeDTO
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/tasks/updateTaskType", method = RequestMethod.POST)
    Response updateTaskType(@RequestBody TasksManagerUpTaskTypeDTO tasksManagerUpTaskTypeDTO);
}
